﻿<UserControl x:Class="SystemModule.Views.NguoiDungDetailView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:prism="http://www.codeplex.com/prism"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:inf_int="clr-namespace:Infrastructure.InteractionRequests;assembly=Infrastructure"
             xmlns:helper="clr-namespace:Infrastructure.Helpers;assembly=Infrastructure"
             xmlns:local="clr-namespace:SystemModule.Views"
             mc:Ignorable="d" 
             d:DesignHeight="720" d:DesignWidth="900" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             x:Name="root" JournalEntry.Name="Chi Tiết người dùng"
             >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/Infrastructure;component/Themes/CommonTemplates.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <helper:SuccessConverter x:Key="SuccessConverter" />
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel>
            <TextBlock Margin="40,10,0,0" Text="Chi tiết người dùng" Grid.ColumnSpan="2"
                       FontWeight="Bold" Foreground="#FF7A7A7A" HorizontalAlignment="Left"  FontFamily="Segoe UI" FontSize="16" />
            <Rectangle Fill="#FFD6D6D6" Height="1" Margin="0,10 0,15" />
            <telerik:RadButton Command="{Binding GoBackCommand}" Content="Quay lại trang trước" Margin="5" HorizontalAlignment="Left" />
        </StackPanel>

        <StackPanel Grid.Row="1" HorizontalAlignment="Center"
					Margin="10">
            <StackPanel Orientation="Horizontal" Margin="5" VerticalAlignment="Center">
                <telerik:RadButton Width="38" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
                                   Command="{Binding SaveCommand}">
                    <telerik:RadButton.Content>
                        <Image Source="/Infrastructure;component/Images/MiniIcon/save_as.png" Height="14" Width="14"/>
                    </telerik:RadButton.Content>
                </telerik:RadButton>
                <TextBlock Text="Lưu thông tin" Foreground="#FF060606" FontSize="12" Margin="40 3 14 3" />
            </StackPanel>
        </StackPanel>

        <Grid Grid.Row="2" HorizontalAlignment="Center" DataContext="{Binding User, Mode=TwoWay}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBlock Text="Tên tài khoản:" Grid.Row="0"  Style="{StaticResource TextBlockStyle}"/>
            <TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Path=TenTaiKhoan,Mode=TwoWay}" />
            <TextBlock Text="Tên người dùng" Grid.Row="1"  Style="{StaticResource TextBlockStyle}"/>
            <TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Path=TenNguoiDung,Mode=TwoWay}" />
            <TextBlock Text="Giới tính:" Grid.Row="2"  Style="{StaticResource TextBlockStyle}"/>
            <StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal" Margin="0 0 0 15" HorizontalAlignment="Center">
                <telerik:RadRadioButton Width="60" Margin="0 0 15 0"
                        IsChecked="{Binding Path=GioiTinh, Mode=TwoWay, Converter={StaticResource SuccessConverter}, ConverterParameter=true}"
						HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Content="Nam" />
                <telerik:RadRadioButton Width="60" IsChecked="{Binding Path=GioiTinh, Mode=TwoWay, Converter={StaticResource SuccessConverter}, ConverterParameter=false}"
						HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Content="Nữ" />
            </StackPanel>
            <TextBlock Text="Điện thoại:" Grid.Row="3"  Style="{StaticResource TextBlockStyle}"/>
            <TextBox Grid.Column="1" Grid.Row="3" Text="{Binding Path=DienThoai,Mode=TwoWay}" />
            <TextBlock Text="Email:" Grid.Row="4"  Style="{StaticResource TextBlockStyle}"/>
            <TextBox Grid.Column="1" Grid.Row="4" Text="{Binding Path=Email,Mode=TwoWay}" />
            <TextBlock Text="Bị khóa:" Grid.Row="6"  Style="{StaticResource TextBlockStyle}"/>
            <telerik:RadToggleButton Grid.Column="1" Grid.Row="6" IsChecked="{Binding Path=IsLocked,Mode=TwoWay}" Width="30" Height="20" Margin="0,0,0,15" />
        </Grid>
        <StackPanel Grid.Column="1" Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" Margin="10">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Border Grid.Row="0" Height="22" BorderBrush="#FFD6D4D4" BorderThickness="0,0,0,1"
							VerticalAlignment="Top" Background="#FFF7F7F7" HorizontalAlignment="Stretch">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                        <TextBlock Text="Danh sách đơn vị"
							 HorizontalAlignment="Center" Margin="2" />
                        <Path  HorizontalAlignment="Right"
							Data="F1M513.7935,318.4341L507.1335,324.7101L512.5495,324.7101L521.4595,316.3111L512.5885,307.9531L507.1735,307.9531L513.7935,314.1921L498.7735,314.1921L498.7735,318.4341z"
							Stretch="Fill" Height="17" Width="22" 
							UseLayoutRounding="False" Margin="2" Fill="#FF2A91EB" />
                    </StackPanel>

                </Border>
                <telerik:RadListBox AllowDrop="True" x:Name="listBox1" Grid.Row="1"
                 ItemContainerStyle="{StaticResource DraggableListBoxItem}"
                                ItemsSource="{Binding DonViList,Mode=TwoWay}"
                 DisplayMemberPath="TenGoi" Width="200" Height="200" SelectionMode="Multiple">
                    <telerik:RadListBox.DragVisualProvider>
                        <telerik:ScreenshotDragVisualProvider />
                    </telerik:RadListBox.DragVisualProvider>
                    <telerik:RadListBox.DragDropBehavior>
                        <telerik:ListBoxDragDropBehavior />
                    </telerik:RadListBox.DragDropBehavior>
                </telerik:RadListBox>
            </Grid>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Border Grid.Row="0" Height="22" BorderBrush="#FFD6D4D4" BorderThickness="0,0,0,1"
							VerticalAlignment="Top" Background="#FFF7F7F7" HorizontalAlignment="Stretch">
                    <TextBlock Text="Danh sách đơn vị của người dùng" Margin="6 2 2 2" HorizontalAlignment="Center" />
                </Border>
                <telerik:RadListBox  AllowDrop="True" ItemsSource="{Binding DonViUserList, Mode=TwoWay}" Grid.Row="1"
                            ItemContainerStyle="{StaticResource DraggableListBoxItem}"
							Width="200"
                                 DisplayMemberPath="TenGoi" Height="200" SelectionMode="Multiple">
                    <telerik:RadListBox.DragVisualProvider>
                        <telerik:ScreenshotDragVisualProvider />
                    </telerik:RadListBox.DragVisualProvider>
                    <telerik:RadListBox.DragDropBehavior>
                        <telerik:ListBoxDragDropBehavior AllowReorder="True" />
                    </telerik:RadListBox.DragDropBehavior>
                </telerik:RadListBox>
            </Grid>
        </StackPanel>
    </Grid>
</UserControl>
